package routers

import (
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/context"
	"myproject/controllers"
)

func init() {
    beego.Router("/", &controllers.MainController{})
    beego.Router("/hello", &controllers.MainController{},"get:Hello")
    beego.Router("/demo/hello", &controllers.DemoController{},"get:Hello")
	beego.Include(&controllers.TestController{})
	filterDemo := func(ctx *context.Context){
		title := "forbidden"
		ctx.WriteString(title)
	}
	beego.InsertFilter("/demo/*",beego.BeforeRouter,filterDemo)
}
